package com.ruoyi.depot.mapper;

import java.util.List;
import com.ruoyi.depot.domain.QualityInspection;
import com.ruoyi.depot.domain.vo.QualityInspectionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 品检Mapper接口
 * 
 * @author luxiaoyu
 * @date 2024-11-05
 */
@Mapper
public interface QualityInspectionMapper 
{
    /**
     * 查询品检
     * 
     * @param inspectionId 品检主键
     * @return 品检
     */
    public QualityInspectionVO selectQualityInspectionByInspectionId(String inspectionId);

    /**
     * 查询品检列表
     * 
     * @param qualityInspection 品检
     * @return 品检集合
     */
    public List<QualityInspectionVO> selectQualityInspectionList(QualityInspection qualityInspection);

    /**
     * 新增品检
     * 
     * @param qualityInspection 品检
     * @return 结果
     */
    public int insertQualityInspection(QualityInspection qualityInspection);

    /**
     * 修改品检
     * 
     * @param qualityInspection 品检
     * @return 结果
     */
    public int updateQualityInspection(QualityInspection qualityInspection);

    /**
     * 删除品检
     * 
     * @param inspectionId 品检主键
     * @return 结果
     */
    public int deleteQualityInspectionByInspectionId(Long inspectionId);

    /**
     * 批量删除品检
     * 
     * @param inspectionIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteQualityInspectionByInspectionIds(@Param("inspectionIds") String[] inspectionIds);

    /**
     * 获取当天最后一个质检单号
     */
	String selectLastInspectionNumberForUpdate();

    /**
     * 查询对应的质检单
     * @param inspectionIds
     * @return
     */
    List<QualityInspection> selectList(@Param("inspectionIds") String[] inspectionIds);

    /**
     * 查询质检单号是否存在
     * @param code
     * @return
     */
    int checkReceiptNumberExists(@Param("code") String code);

    /**
     * 批量插入质检单
     * @param inspectionsToInsert
     * @return
     */
    int insertBatch(@Param("list") List<QualityInspection> inspectionsToInsert);
}
